<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<div id="app">
    {{msg}}==={{n}}
    <hr>
    <button v-on:click="n++">按钮1</button>
    <button @click="n--">按钮2</button>
    <button @click="btn(5)">按钮1</button>
    <button @click="handle">点击我让h1盒子显示和隐藏</button>
    <h1 v-show="flag">h1盒子</h1>






</div>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.min.js"></script>
<script>
    const vu = new Vue({
            el: "#app",
            data: {
                msg: 'hello vue',
                n: 6,
                flag: true

            },
            methods: {
                btn(x) {
                    console.log(this.n)
                    this.n += x

                },
                handle() {
                    this.flag = !this.flag

                }

            },

        })
        // console.log(vu.title) //取数据
        // console.log(vu.title = '插值表达式111') //改数据
</script>






</body>

</html>